package serverdata.ch.home.www;

public class SensorCoding {

	public enum SENSORI{
		ACC,AMBTEMP,GRAV,GYRO,LIGHT,LINACC,MAG,ORIENT,PRESS,PROX,RELHUM,ROTA,TEMP,UNDEF
	}
	private SENSORI sensor;
	
	public SensorCoding(String param) {
	
		if(param.contains("ACC")){
			sensor = SENSORI.ACC;
		}
		else if(param.contains("AMB")){
			sensor = SENSORI.AMBTEMP;
		}
		else if(param.contains("GRAV")){
			sensor = SENSORI.GRAV;
		}
		else if(param.contains("GYRO") || param.contains("GIRO")){
			sensor = SENSORI.GYRO;
		}
		else if(param.contains("LIGHT") || param.contains("LUCE")){
			sensor = SENSORI.LIGHT;
		}
		else if(param.contains("LIN")){
			sensor = SENSORI.LINACC;
		}
		else if(param.contains("MAG")){
			sensor = SENSORI.MAG;
		}
		else if(param.contains("ORIENT")){
			sensor = SENSORI.ORIENT;
		}
		else if(param.contains("PRESS")){
			sensor = SENSORI.PRESS;
		}
		else if(param.contains("PROX") || param.contains("PROSS")){
			sensor = SENSORI.PROX;
		}
		else if(param.contains("HUM") || param.contains("UMID")){
			sensor = SENSORI.RELHUM;
		}
		else if(param.contains("ROTA")){
			sensor = SENSORI.ROTA;
		}
		else if(param.contains("TEMP")){
			sensor = SENSORI.TEMP;
		}
		else{
			sensor = SENSORI.UNDEF;
		}
	}
	
	public SENSORI getSensor(){
		return sensor;
	}
	

}
